﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PowerPoint = Microsoft.Office.Interop.PowerPoint;
using Core = Microsoft.Office.Core;

namespace ServerTCP
{
   public class ControlPowerPoint
    {
        private PowerPoint.Application PPA;
        private PowerPoint.Presentation PPE;
        String Path = "D:/b.ppt";
        public void OpenPowerPoint()
        {
            PPA = new PowerPoint.Application();
            PPA.WindowState = PowerPoint.PpWindowState.ppWindowNormal;
            //PPE = PPA.Presentations.Open(Path, Core.MsoTriState.msoFalse, Core.MsoTriState.msoFalse, Core.MsoTriState.msoTrue);
            PPE = PPA.Presentations.Open(Path, Core.MsoTriState.msoFalse, Core.MsoTriState.msoFalse, Core.MsoTriState.msoTrue);
            PPE.SlideShowSettings.Run();
        }
        public void Next()
        {
            PowerPoint.SlideShowView next = PPE.SlideShowWindow.View;
            next.Next();
        }
        public void Previous()
        {
            PowerPoint.SlideShowView previous = PPE.SlideShowWindow.View;
            previous.Previous();
        }
        public void Home()
        {
            PowerPoint.SlideShowView previous = PPE.SlideShowWindow.View;
            previous.First();

        }
        public void End()
        {
            PowerPoint.SlideShowView previous = PPE.SlideShowWindow.View;
            previous.Last();
        }
        public void Close()
        {
            PPA.Quit();
            PPE.Close();
        }
    }
}
